home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / ABUSESRC.ZIP / AbuseSrc / macabuse / src / net / mac / listtst.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-20  |  462 b   |  27 lines

  1. #include "isllist.hpp"
  2. #include <stdio.h>
  3.  
  4. isllist<int> tst;
  5. typedef isllist<int>::iterator p_int;
  6.  
  7. main()
  8. {
  9.     tst.insert(5);
  10.     tst.insert(4);
  11.     tst.insert(3);
  12.     tst.insert(2);
  13.     tst.insert(1);
  14.  
  15.     for ( p_int p = tst.begin(); p != tst.end(); ++p)
  16.         printf("%d, ", *p);
  17.     
  18.     p_int x = tst.begin_prev();
  19.     if (tst.find_prev(x, 3))
  20.         tst.insert_next(x, 9);
  21.     
  22.     for ( p = tst.begin(); p != tst.end(); ++p)
  23.         printf("%d, ", *p);
  24.     
  25.     tst.erase_all();
  26. }
  27.